import React, { useState, useEffect } from 'react'
import store from './redux/store'

export default function Test() {
  //   const [a, setA] = useState(0)

  //   useEffect(() => {
  //     store.subscribe(() => {
  //       //   console.log('store的数据改变了', store.getState())
  //       setA((a) => a + 1)
  //     })
  //   }, [])
  return (
    <div>
      test
      <hr />
      <p>{store.getState().count}</p>
      <button
        onClick={() => {
          store.dispatch({ type: 'sub' })
        }}
      >
        -
      </button>
    </div>
  )
}
